﻿function implant(type, address) {
    switch (type) {
        case "machinesum":
        case "devicestatus":
        case "wipreport":
        case "testprod":
        case "outputplanreport":
        case "tsya":
        case "lduyield":
        case "failuremodeboxplot":
        case "yieldboard":
        case "yieldtriggerreport":
        case "yieldfailuremode":
        case "devicebytestyield": 
        case "topnparmtrend":
        case "deviceassemblyyield":
        case "reportyield":
        case "utilizationrate":
        /*case "dayouput":*/
        /*case "yield":*/
        /*case "equipment":*/
        case "teststrend":
        case "assemblyprod":
        case "assemblyyield":
        case "assemblydefect":
        case "jobnumreachrate": 
        case "oeereport":
        case "testerprod":
        case "reportoee":
        case "hpureport":
        case "hpubyyieldreport":
        case "fainoutwiptrend":
            $('.implant').append('<iframe id="Frame" name="preview" src="' + address + '"  border="0" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" style="width: 100%; height: 100%; overflow: hidden;" allowfullscreen="true"></iframe>');
            return;
            break;
        case "fyoee":
            window.open(address, "_blank");
            return;
            break;
        default:
            if (type != "" && type != null && type != undefined) {
                window.location.href = `${url}/Home/Error`;
            }
            else {
                $('.implant').append('<iframe id="Frame" name="preview" src="' + address + '/Home/Report?type=YieldFailureMode" border="0" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" style="width: 100%; height: 100%; overflow: hidden;" allowfullscreen="true"></iframe>');
            }
            return;
            break;
    }
}

//$(document).ready(function () {
//    var type = "@ViewBag.Type";
//if (type != "" && type != null && type != undefined) {
//    $('.implant').append('<iframe id="Frame" name="preview" src="http://localhost:50401/dashboard/show/@ViewBag.Type/" border="0" marginwidth="0" marginheight="0" frameborder="0" style="width: 100%; height: 100%; overflow: hidden;"></iframe>');

//    }
//else {
//    $('.implant').append('<iframe id="Frame" name="preview" src="http://localhost/" border="0" marginwidth="0" marginheight="0" frameborder="0" style="width: 100%; height: 100%; overflow: hidden;"></iframe>');
//    }
//console.log("url:"+"http://localhost:50401/dashboard/show/@ViewBag.Type/");
//});

/*
使用 vue.js
删除 iframe 标签
$(".py-1").remove();
$(".page-foot").remove();

//$(document).load(function () {
//    $("#container").remove();
//});

//$(document).ready(function () {
//    $('body').css({
//        'width': '100%',
//        'height': '100%'
//    });
//});
* /

/*
var pamr = [];
var vaue =
{
    name: "dqy",
    gae: 12,
    adds: "湖北"
};
pamr[vaue];//pamr.push(vaue);

var str = "1cf560b561892530b5e4";
var arry = Array();
for (var i = 0; i < str.length; i++) {
    arry.push(str[i]);
}
arry.sort();
console.log(arry.toString());
*/